/**
 * <p>
 * 表格配置
 *
 * @Author：Roy
 * @Description：楼栋
 * @Date：Create by 2023-11-23 09:55:22
 */
// 隐藏操作按钮的规则配置，字段名：isEdit
const isHidden = (list, row) => {
  const { isEdit } = row || {}
  return list.includes(String(isEdit))
}

const headerConfig = {
  'scene-edifice': [
    {
      prop: 'projectName',
      name: '所属项目',
      minWidth: 110
    },
    {
      prop: 'edificeName',
      name: '楼栋名称',
      minWidth: 110
    },
    {
      prop: 'floorArea',
      name: '建筑面积(m²)',
      minWidth: 110
    },
    {
      prop: 'startNum',
      name: '开始楼层',
      minWidth: 110
    },
    {
      prop: 'endNum',
      name: '结束楼层',
      minWidth: 110
    },
    {
      name: '操作',
      width: 200,
      fixed: 'right',
      thStyle: { 'text-align': 'left' },
      operateList: [
        {
          type: 'btnText',
          label: '查看',
          id: 'scene-edifice-look',
          authId: 'ecp-admin:sceneEdifice:search',
          config: { type: 'text' },
          style: { color: 'rgb(219,139,57)' },
          hidden: (val) => {
            return false // !isHidden(['1'], val)
          }
        },
        {
          type: 'btnText',
          label: '编辑',
          id: 'scene-edifice-edit',
          authId: 'ecp-admin:sceneEdifice:update',
          config: { type: 'text' },
          style: { color: 'rgb(219,139,57)' },
          hidden: (val) => {
            return false // !isHidden(['1'], val)
          }
        },
        {
          type: 'btnText',
          label: '查看设备列表',
          id: 'scene-company-look-facility',
          authId: 'ecp-admin:device:search',
          config: { type: 'text' },
          style: { color: 'rgb(219,139,57)' },
          hidden: (val) => {
            return false // !isHidden(['1'], val)
          }
        },
        {
          type: 'btnText',
          label: '删除',
          id: 'scene-edifice-delete',
          authId: 'ecp-admin:sceneEdifice:deleteById',
          isMore: true,
          config: { type: 'text' },
          style: { color: '#ff0000' },
          hidden: (val) => {
            return false // !isHidden(['1'], val)
          }
        }
      ]
    }
  ]
}

export default {}
export { headerConfig }
